<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:replace="m/head :: head"></div>

    <title>登录</title>
</head>

<body>
<div class="loginwrap">
    <div class="login-title">
        <a th:href="@{/}">取消</a>
    </div>
    <div class="login-con">
        <form th:action="@{/login}" th:method="post">
            <div class="logo">
                <img th:src="@{/static/m/img/logo-2.png}"/>
            </div>
            <div class="logo-text">
                <img th:src="@{/static/m/img/login-text.png}"/>
            </div>
            <div class="login-input">
                <div class="login-text clearfix">
                    <div class="left">
                        手机号
                    </div>
                    <div class="right">
                        <input type="text" name="username" th:value="${session.SPRING_SECURITY_LAST_USERNAME}" placeholder="输入手机号"/>
                    </div>
                </div>
                <div class="login-text">
                    <div class="left">
                        输入密码
                    </div>
                    <div class="right">
                        <input type="password" name="password" value="" placeholder="6-20位字母、数字、下划线"/>
                    </div>
                </div>
                <p class="error" th:text="${session.SPRING_SECURITY_LAST_EXCEPTION ne null ? (session.SPRING_SECURITY_LAST_EXCEPTION.message eq 'Bad credentials' ? '用户名或密码错误' : session.SPRING_SECURITY_LAST_EXCEPTION.message) : ''}"></p>
            </div>
            <div class="login-link clearfix">
                <a th:href="@{/retrieve}" style="color: #ff5722;">忘记密码</a>
                <a th:href="@{/register}" style="float: right;color: rgb(160,160,160);">注册</a>
            </div>
            <input type="submit" class="submit" value="登录"/>
            <a th:href="@{/login-sms}" class="iphone">手机号验证登录</a>
        </form>
    </div>
</div>

</body>

<div th:replace="m/foot :: footer('baidu.hide')"></div>

<script>
    $('input').focus(function () {
        setTimeout(function () {
            $('.error').text('');
        }, 1000);
    })
</script>

</html>
